<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <title>5_演示函数柯里化</title>
</head>

<body>
  <script type="text/javascript">
    /* 函数求和 */
    /* 方式一
     function sum(a, b, c) {
      return a + b + c
    } 
    console.log(sum(1, 2, 3));
    */
    /* 方式二
    function add(a) {
      return (b) => {
        return (c) => {
          return a + b + c
        }
      }
    } */
    /* 方式三同方式二等价 */
    const conAdd = a => b => c => a + b + c;
    console.log(conAdd(1)(2)(3));
  </script>
</body>

</html>